package com.yykj.hospital.server.converter;

import com.yykj.hospital.server.dto.banci.DoctorVisitSettingDTO;
import com.yykj.hospital.server.model.entity.banci.HospitalDoctorVisitSetting;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

public class DoctorVisitDTOConverter {
    public static DoctorVisitSettingDTO convert(HospitalDoctorVisitSetting item){
        DoctorVisitSettingDTO dto = new DoctorVisitSettingDTO();
        BeanUtils.copyProperties(item,dto);
        return dto;
    }

    public static List<DoctorVisitSettingDTO> convert(List<HospitalDoctorVisitSetting> list){
        return list.stream().map(DoctorVisitDTOConverter::convert).collect(Collectors.toList());
    }
}
